# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lbreakouthd
pkgver=1.0.10
pkgrel=0
pkgdesc="Ball-and-paddle game (LBreakout2 successor)"
url="https://lgames.sourceforge.io/LBreakoutHD/"
arch="all"
license="GPL-2.0-or-later"
depends="$pkgname-data"
makedepends="
	sdl2-dev sdl2_image-dev
	sdl2_mixer-dev sdl2_ttf-dev
	"
subpackages="$pkgname-data::noarch"
source="https://sourceforge.net/projects/lgames/files/lbreakouthd/lbreakouthd-$pkgver.tar.gz
	0001-fix-undeclared-uint.patch
	"
options="!check" # No test suite

prepare() {
	default_prepare
	update_config_guess
	update_config_sub
}

# Fails to build on builders if we enable nls (Native Language Support):
# ERROR: gettext-tiny-dev-0.3.2-r0: trying to overwrite usr/include/libintl.h owned by musl-libintl-1.2.2-r3

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--sysconfdir=/etc \
		--localstatedir=/var/lbreakouthd \
		--prefix=/usr \
		--disable-nls
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

data() {
	pkgdesc="$pkgdesc (data files)"
	mkdir -p "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/lbreakouthd \
		"$subpkgdir"/usr/share/
}

sha512sums="
520bda4a438b749fa03acdfdb977c8e88189baf8f1820ff00ad5c607f740f9b753c1698503678ab7ad2f5d053690976026e5a6e996fe7b07af567865eab0f7fe  lbreakouthd-1.0.10.tar.gz
4de6934a7840153354f54c5c6a9c14d22e3d5a76030cd33131c2511d97c363d73912d53d3581fd756ff42dec9c7d4e819056e5a2eee5d92064a88a9337abe5eb  0001-fix-undeclared-uint.patch
"
